<?php $aProduct=$this->aDisplayedContent['content'];
      	$iProductID = $aProduct['id'];

if($GLOBALS['ISMOBILE'] == 0){
?>
<style>
.galleria {
	height: 400px;
	background: #000;
	padding-bottom: 30px;
}
</style>

<script src="../js/js/jquery-1.7.2.min.js"> </script>

 <script>

$(document).ready(function() {	

	//select all the a tag with name equal to modal
	$('a[name=modal2]').click(function(e) {
		//Cancel the link behavior
		
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
		 
	
		
		//transition effect
		$(id).fadeIn(2000); 
		$.ajax({
			type: "POST",
			url:  "index.php?a=ajax&co=priceRequest&id=<?php echo $iProductID?>&m=getViewContent",
			success: function(data){
            var template = data;
            $('#dialog').html(template);
          }
		})   
	});
	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			

	$(window).resize(function () {
	 
 		var box = $('#boxes .window');
 
        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
      
        //Set height and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});
               
        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        box.css('top',  winH/2 - box.height()/2);
        box.css('left', winW/2 - box.width()/2);
	 
	});
	
});

</script>

<?php }?>


<link rel="stylesheet" href="./template/css/pricerequest.css" type="text/css" media="screen" />
<div id="boxes">
	

<div id="dialog" class="window">



<a href="#"class="close"/>Close it</a>
</div>

<!-- Mask to cover the whole screen -->
  <div id="mask"></div>
</div>

<form action="index.php?co=priceRequest&id=<?=$aProduct['id']?>" method="post">
	<?php if($GLOBALS['ISMOBILE'] == 0){?>
	<p align="right"><a href="#dialog" align="right" name="modal2"><input type="submit" value="<?php if (isset($this->aDisplayedContent['priceRequestLabel'])){echo $this->aDisplayedContent['priceRequestLabel'];}else{echo "P";}?>" class="button-slide"></input></a></p>
	<?php }else{?>
	<p align="right"><input type="submit" value="<?php if (isset($this->aDisplayedContent['priceRequestLabel'])){echo $this->aDisplayedContent['priceRequestLabel'];}else{echo "P";}?>" class="button-slide"></input></p>
	<?php }?>
	</form>

<h2><?=$aProduct['name']?></h2>
				
	<div class="galleria">
  

	<?php $aImages = $this->aDisplayedContent['images'];
	if(!empty($aImages[0])){
	    foreach ($aImages as $aImage){
		    $sImage = $aImage['link'];
		    
			echo "<a href='../image/$sImage'><img src=../image/thumbs/$sImage></a>";
		
	}
	}else{ ?>
	    <a href="../image/<?=DEFAULT_PRODUCT_IMAGE?>" target="_blank"><img src="../image/thumbs/<?=DEFAULT_PRODUCT_IMAGE?>" border="0" width="100" height="70"/></a>
	<?php }	?>
		
</div>
	<script>
    Galleria.loadTheme('../js/galleria/themes/classic/galleria.classic.min.js');
    Galleria.run('.galleria', {
    	thumbCrop: false,
    	lightbox: true
    });
    </script>
	<br><?=$aProduct['long_description']?><br>
	